#include <stdio.h>
#include <time.h>
#include <unistd.h>

struct timespec start_time;
struct timespec end_time;

int main(){
	
	clock_gettime(CLOCK_REALTIME,&start_time);
	sleep(10);
	clock_gettime(CLOCK_REALTIME,&end_time);

	int sec = -(start_time.tv_sec - end_time.tv_sec);
	int n_sec = -(start_time.tv_nsec - end_time.tv_nsec);

	printf("sec: %d ,nsec: %d\n",sec,n_sec);

	return 0;
}
